package com.ixiaowo.springcouldconsumermovie.controller;


import com.ixiaowo.springcouldconsumermovie.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class MoiveController {
    @Resource
    private RestTemplate restTemplate;
    @GetMapping("/movie/{id}")
    public User findById(@PathVariable Long id){
      return  this.restTemplate.getForObject("http://localhost:8080/simple/"+id, User.class);
    }
}
